<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

include('dbmanager.php');

$dbh = dbmanager::singleton();

if (!$dbh) {
    die("Error in connection: " . pg_last_error());
}

/*
  for ($i = 0; $i < sizeof($_POST); ++$i) {
  echo $_POST[$i] . "<br />";
  }
 */
//$csv = $_POST['csv'];
//$sign = $_POST['sign'];
// dodać spr. poprawności sign
// host=$hostname&os=$os&version=$servicepack&user_name=$name&user_last_name=$last_name&login=$login
$query = "SELECT * FROM messages WHERE id_sender=" . $_POST['id'] . " OR id_reciever=" . $_POST['id'] . " ORDER BY update;";

echo $dbh->execute_query_json($query);
?>
